<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %>

<asp:Content ID="Title" ContentPlaceHolderID="TitleContent" runat="server">
    <%= ViewData["PageTitle"] %>
</asp:Content>

<asp:Content ID="Javascript" ContentPlaceHolderID="JavascriptContent" runat="server">
    <script src="/Scripts/jQuery-1.3.2.js" type="text/javascript"></script>  
    <script src="http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.2" type="text/javascript"></script>
    <script src="/Scripts/Map.js" type="text/javascript"></script>
</asp:Content>

<asp:Content ID="indexContent" ContentPlaceHolderID="MainContent" runat="server">
    
    <h2><%= ViewData["PageTitle"] %></h2>

    <div id="mapDivLeft">

        <div id="searchBox">
            Enter your location: <%= Html.TextBox("Location") %> within <%= Html.TextBox("Within") %> miles. <input id="search" type="submit" value="Search" />
        </div>

        <div id="theMap">
        </div>

        <p><%= Html.ActionLink( "View All Upcoming Dinners", "Upcoming", "Dinners" ) %></p>
        <p><%= Html.ActionLink( "View All Dinners", "All", "Dinners" ) %></p>
        
    </div>

    <div id="mapDivRight">
        <div id="dinnerList"></div>
    </div>

    <script type="text/javascript">

        $(document).ready(function() {
            ShowUpComingDinners();
        });

        $("#search").click(function(evt) {
            var where = jQuery.trim($("#Location").val());
            if (where.length == 0) 
                return;
            FindDinnersGivenLocation(where);
        });

    </script>
    
</asp:Content>
